﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autofac;
using NCLCustomerManagement.DataAccess.IocRegistration;

namespace NCLCustomerManagement.BusinessLogic.IocRegistration
{
    public class BusinessModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterModule(new DataAccessModule());
            RegisterBCs(builder);
        }

        private void RegisterBCs(ContainerBuilder builder)
        {
            builder.RegisterAssemblyTypes(typeof(BusinessModule).Assembly)
                .Where(t => t.Name.EndsWith("BC"))
                .AsImplementedInterfaces()
                .PropertiesAutowired();
        }
    }
}
